<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>19_遍历数组-动态添加-createElement</title>
    </head>
    <body>
        
        <script>
            var arr = ['李宁','回力','361度','安踏','鸿星尔克','斯凯奇'];

            var ul =document.createElement('ul');

            for(var i = 0; i < arr.length; i++){
                // 创建换一个li对象
                var li = document.createElement('li');
                // 给li标签的内容赋值
                li.innerHTML = arr[i];

                ul.append(li);
            }
            document.body.append(ul);
        </script>


    </body>
</html>